<template>
    <div>
        <button @click="add">click</button>
    </div>
</template>

<script setup lang="ts">
interface Emits {
    (e: string, num: number, str?: string): void  //检查emit中的参数，并检查传给父组件接收到的数据
}
const emit = defineEmits<Emits>()
const add = () => {
    emit("sendParent", 888)
}
</script>

<style scoped></style>